from django.db import models

class Blacklist(models.Model):
    phone_number = models.CharField(max_length=20,unique=True)
    region = models.CharField(max_length=30)
    service_providers = models.CharField(max_length=30)
    message = models.CharField(max_length=30)
    date_added = models.DateTimeField('date added')
    last_updated = models.DateTimeField('last updated')

    def __unicode__(self):
        return ', '.join([self.phone_number, self.region, self.service_providers, self.message])

class Contribution(models.Model):
    phone_number = models.CharField(max_length=20)
    user_phone_number = models.CharField(max_length=20)
    comment = models.CharField(max_length=60)
    date_added = models.DateTimeField('date added')

    def __unicode__(self):
        return ', '.join([self.phone_number, self.user_phone_number, self.comment])

class Blocklist(models.Model):
    user_phone_number = models.CharField(max_length=20)
    block_phone_number= models.CharField(max_length=20)
    block_time = models.DateTimeField('block time')
    date_added = models.DateTimeField('date added')

    def __unicode__(self):
        return ', '.join([self.phone_number, self.user_phone_number, self.block_time])
